package demo6;
//Resource 是Java提供的注解

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

@Component
public class Person {
    //@Resource(name="sweater")  //就是不管你这个类名是大写小写的那么首字母都必须小写  其余与类名完全一致就可
    //private Clothes clothes;

    //@Override
    //public String toString() {
      //  return "Person{" +
        //        "clothes=" + clothes +
          //      '}';
    //}
    @Resource
    private  Clothes shirt ;  //还可以根据和属性装配，与类名一致

    @Override
    public String toString() {
        return "Person{" +
                "shirt=" + shirt +
                '}';
    }
}
